using System;

namespace Flood.Log
{
	public class ShapeStatusChanged : IChange
	{
		private readonly Status oldStatus;
		private readonly Shape shape;
		private readonly Action<Status> undoStatusChange;

		public ShapeStatusChanged(Shape shape, Action<Status> undoStatusChange, Status oldStatus)
		{
			this.shape = shape;
			this.undoStatusChange = undoStatusChange;
			this.oldStatus = oldStatus;
		}

		#region IChange Members

		public Shape Shape
		{
			get { return shape; }
		}

		public void Undo()
		{
			undoStatusChange(oldStatus);
		}

		#endregion
	}
}